<%@page import="biz.impl.NewsBizImpl"%>
<%@page import="biz.NewsBiz"%>
<%@page import="entity.News"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("utf-8");
	String title = request.getParameter("title");
	News n = new News();
	n.setTitle(title);
	
	NewsBiz biz = new NewsBizImpl();
	if(biz.publishNews(n)){
		response.sendRedirect("index.jsp");
	}else{
		request.setAttribute("msg", "发布失败");
		request.getRequestDispatcher("publish.jsp").forward(request, response);
	}

%>